package cn.tedu.charging.user.controller;


import cn.tedu.charging.common.result.JsonResult;
import cn.tedu.charging.common.pojo.vo.UserInfoVO;
import cn.tedu.charging.user.service.UserService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("v1/user/")
@Api(tags = "用户模块")
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("info/{userId}")
    public JsonResult<UserInfoVO> getUserInfo(@PathVariable Integer userId){
        log.info("查询用户信息，userId={}",userId);
        UserInfoVO userInfo = userService.getUserInfo(userId);
        return JsonResult.ok(userInfo);
    }
}
